package org.sharelife.service;

import java.util.List;

import org.sharelife.entity.Message;
import org.sharelife.util.PageBean;

public interface MessageService {
	
	// 根据id删除评论
	public void deleteById(int id)throws Exception;
	
	// 查询所有评论
	public List<Message> findAll() throws Exception;
	
	// 根据ID查询评论
	public Message findById(int id) throws Exception;
	
	// 根据用户ID查询所有评论
	public List<Message> findByUserId(int id)throws Exception;
	
	//根据图片id分页查询评论
	public PageBean queryForPageByPictureId(int id, int pageSize, int page)throws Exception;
	
	// 添加评论
	public void add(Message message) throws Exception;
	
	// 修改评论信息
	public void modify(Message message) throws Exception;
	
	// 分页查询
	public PageBean queryForPage(int pageSize, int page) throws Exception;
	
	// 根据用户ID分页查询评论
	public PageBean queryForPageByUserId(int id, int pageSize, int page) throws Exception;
	
	// 根据发布时间查询前5条记录
	public List<Message> findByDate()throws Exception;
	
	//根据关键字分页查询评论
	public PageBean queryForPageByKeyWords(String keyWord, int pageSize,
			int page)throws Exception ;
}
